#ifndef BYOGAMEBASE_H
#define BYOGAMEBASE_H

#include <wx/window.h>
#include <wx/string.h>

class wxDC;
class wxColour;
class wxFocusEvent;
class wxSizeEvent;

class GameBase: public wxWindow {
  public:
    GameBase( wxWindow* parent, const wxString& GameName );
    virtual ~GameBase();
    inline const wxString& GetGameName() const { return m_GameName; }
    static void ReloadFromConfig();
    static void BackToWorkTimer();
  protected:
    void RecalculateSizeHints( int minStepsHoriz, int minStepsVert );
    void GetCellAbsolutePos( int cellX, int cellY, int& posX, int& posY ) const;
    void DrawBrickAbsolute( wxDC* DC, int posX, int posY, int width, int height, const wxColour& base );
    void DrawBrick( wxDC* DC, int cellX, int cellY, const wxColour& base );
    void DrawGuidelines( wxDC* DC, int offset, int columns, int rows, const wxColour& base );
    const wxColour& GetColour( int index ) const;
    bool SetPause( bool pause = true );
    inline bool IsPaused() const { return m_Paused; }
    wxString GetBackToWorkString() const;
  private:
    WX_DEFINE_ARRAY( GameBase*, GamesListT );
    void OnSize( wxSizeEvent& event );
    void OnKillFocus( wxFocusEvent& event );
    int m_CellSize;
    int m_FirstCellXPos;
    int m_FirstCellYPos;
    int m_MinCellsHoriz;
    int m_MinCellsVert;
    bool m_Paused;
    wxString m_GameName;
    static GamesListT AllGames;
    DECLARE_EVENT_TABLE()
};

#endif
